package cn.xxmi.mybatis.mapper;

import cn.xxmi.mybatis.model.SysRole;
import cn.xxmi.mybatis.model.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    SysUser selectById(Long id);

    List<SysUser> selectAll();

    List<SysRole> selectRolesUserById(Long id);

    Long insert(SysUser sysUser);

    Long insert2(SysUser sysUser);

    Long insert3(SysUser sysUser);

    int updateUserById(SysUser sysUser);

    int deleteUserById(SysUser sysUser);

    List<SysRole> selectRolesByUserIdAndRoleEnabled(@Param(value = "id") Long id, @Param("enabled") int enabled);

    List<SysUser> selectByUser(SysUser sysUser);

    SysUser selectByIdOrUsername(@Param("user") SysUser sysUser);

    List<SysUser> selectList(SysUser user);

    List<SysUser> selectList2(SysUser user);

    List<SysUser> queryList2(SysUser user);

    List<SysUser> queryForeach(@Param("ids") List<Long> ids);

    //    List<SysUser> queryForeach2(@Param("map") Map map);
    List<SysUser> queryForeach2(Map map);

    int updateById(SysUser sysUser);

    int updateById2(SysUser sysUser);

    //    int batchInsert(@Param("users") List<SysUser> users);
    int batchInsert(List<SysUser> users);

    int update2(Map map);

    SysUser advQueryOneToOne(Long id);

    SysUser advQueryOneToOne2(Long id);

    SysUser advQueryOneToOne3(Long id);

    SysUser advOneToMany(Long id);

    SysUser oneToMany2(Long id);

    SysUser queryUserById(Long id);

    void callSelectUserById(SysUser user);

    List<SysUser> callSelectUserPage(Map map);

    int callInsertUserAndRoles(@Param("user") SysUser user, @Param("roles") String roles);

    int callDeleteUserAndRoles(Long id);
}
